<!DOCTYPE HTML>
<html lang="zh">
<head>
    <meta charset="<?php $this->options->charset(); ?>">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1.0,maximum-scale=1.0, minimum-scale=1.0" name="viewport">
    <link rel="icon" type="image/png" href="<?php $this->options->favicon(); ?>">
    <link href="<?php $this->options->favicon(); ?>" rel="icon">
    <link rel="apple-touch-icon-precomposed" href="<?php $this->options->favicon(); ?>">
    <title><?php $this->archiveTitle(array(
            'category'  =>  _t('分类 %s 下的文章'),
            'search'    =>  _t('包含关键字 %s 的文章'),
            'tag'       =>  _t('标签 %s 下的文章'),
            'author'    =>  _t('%s 发布的文章')
        ), '', ' - '); ?><?php $this->options->title(); ?></title>
    <!-- 使用url函数转换相关路径 -->
    <link rel="stylesheet" href="<?php $this->options->themeUrl('style.css'); ?>">
    <!-- 自定义页面样式 -->
    <style type="text/css"><?php $this->options->CustomCSS(); ?></style>
    <!-- 通过自有函数输出HTML头部信息 -->
    <?php $this->header(); ?>
</head>
<body>

<div id="main">
    <header id="header">
        <div id="header-title">
            <h2><?php $this->options->title(); ?></h2>
        </div>
        <div id="header-content">
            <p><?php $this->options->description() ?></p>
            <div id="header-content-right">
             <nav>
                <a href="<?php $this->options->siteUrl() ?>" <?php if ($this->is('index')) : ?> class="nav-focus"<?php endif; ?>>首页</a>
                <?php $this->widget('Widget_Contents_Page_List')->to($pages); ?>
                <?php while($pages->next()): ?>
                <a<?php if($this->is('page', $pages->slug)): ?> class="current"<?php endif; ?> href="<?php $pages->permalink(); ?>" title="<?php $pages->title(); ?>"><?php $pages->title(); ?></a>
                <?php endwhile; ?>
             </nav>
        </div>
    </header>
<hr>

<div class="header__below-sign">
  <?php if ($this->user->hasLogin()) : ?>
    <div class="_dropdown" trigger="click">
     <div class="_dropdown__link">
        <span>用户名：<?php $this->user->screenName(); ?></span>
     </div>
    <nav class="_dropdown__menu">
        <a rel="noopener noreferrer nofollow" target="_blank" href="<?php $this->options->adminUrl(); ?>">进入后台</a>
        <a href="<?php $this->options->logoutUrl(); ?>">退出登录</a>
    </nav>
    </div>
    <?php else : ?>
    <div class="item">
      <button onclick="dog.showModal()">登录</button>
    </div>
    <?php endif; ?>
    <dialog id="dog">
    <div class="win">
        <form method="dialog">
            <div class="login-bottom">
                <button class>关闭弹窗</button>
            </div>
        </form>
        <form action="<?php $this->options->loginAction()?>" method="post" name="login" rold="form">
            <input type="hidden" name="referer" value="<?php $this->options->siteUrl(); ?>">
            <p>
                <input type="text" name="name" autocomplete="username" placeholder="请输入用户名" style="padding: 10px;border-radius: 8px;font-size: 1.14286em;" required/>
            </p>
            <p>
                <input type="password" name="password" autocomplete="current-password" placeholder="请输入密码" style="padding: 10px;border-radius: 8px;font-size: 1.14286em;" required/>
            </p>
            <p>
                <label for="remember">
                    <input<?php if(\Typecho\Cookie::get('__typecho_remember_remember')): ?> checked<?php endif; ?> type="checkbox" name="remember" class="checkbox" value="1" id="remember" /> <?php _e('下次自动登录'); ?>
                </label>
            </p>
            <div class="login-bottom">
                <button class type="submit" class="btn btn-l w-100 primary">登录站点</button>
            </div>
        </form>
    </div>
    </dialog>
</div>
<hr>